{include file='../header.tpl'}



<div class="container">

    <div class="content">
        <div class="page-header">
            <h2>{$postToView->getTitle()}</h2>


        </div>
        <div class="row">

            <div id="content" class="span11">
            {$postToView->getContent()}
            {if $this->session->userdata('loggedin')}
                <div class="comment-rating">
                    <span onclick="postVoteUp({$postToView->getId()});"><span
                            class="rating-button positive"></span></span>
                    <span onclick="postVoteDown({$postToView->getId()});"><span
                            class="rating-button negative"></span></span>

                    <div id="PID{$postToView->getId()}_upVotes" class="rating-total">{$postToView->getUpVotes()}</div>
                    <div id="PID{$postToView->getId()}_downVotes"
                         class="rating-total">{$postToView->getDownVotes()}</div>
                </div>
            {/if}

            </div>


            <div class="span5">
                <div>
                    <h3><i class="icon-info-sign"></i>Informatie</h3>
                    <dl>
                        <dt>Auteur</dt>
                        <dd>
                            <a href="/user/view/{$postToView->getAuthor()->getUsername()}">{$postToView->getAuthor()}</a>
                        </dd>
                        <dt>Categorie</dt>
                        <dd><a href="/category/{$postToView->getCategory()}">{$postToView->getCategory()}</a></dd>
                        <dt>Geschreven op</dt>
                        <dd>{$postToView->getDateCreated()->format('j-n-Y')}</dd>
                        <dt>Aantal keer gelezen</dt>
                        <dd>{$postToView->getReadCount()}</dd>
                        <dt>Aantal reacties</dt>
                        <dd>{count($postToView->getComments())}</dd>
                        <dt>Waardering</dt>
                        <dd>{$postToView->getPostRating()}</dd>
                    </dl>
                </div>
                <div>
                    <h3><i class="icon-tags"></i>Tags</h3>
                {foreach from=$postToView->getTags() item=tag}
                    <span class="label tag-label"><i class="icon-tag icon-white"></i>{$tag->getName()}</span>
                {/foreach}
                </div>
                <div class="clearme"></div>

            {if count($postToView->getMedia()) != 0 }
                <div>
                    <h3><i class="icon-picture"></i>Media</h3>


                    <div class="row" id="post-thumbs">
                        {foreach $postToView->getMedia() as $media}

                            <div id="modalImage{$media@index}" class="modal fade out">
                                <div class="modal-header">
                                    <a href="#" class="close"><i class="icon-remove"></i></a>

                                    <h3>{$postToView->getTitle()}</h3>
                                </div>
                                <div class="modal-body">
                                    <img src="/uploads/{$media->getLocation()}" alt="{$media->getDescription()}">
                                </div>
                                <div class="modal-footer">
                                    <p>{$media->getDescription()}</p>
                                </div>
                            </div>
                            <a data-controls-modal="modalImage{$media@index}" data-toggle="modalImage{$media@index}"
                               data-backdrop="true" data-keyboard="true" href="#">
                                <img src="/uploads/thumbs/thumb_{$media->getLocation()}"
                                     alt="{$media->getDescription()}">
                            </a>
                        {/foreach}
                    </div>
                </div>
            {/if}

            {if $postHasTweets}
            {include file="twitter/feed.tpl"}
            {/if}


            </div>


        </div>
        <a href="/post/printView/{$postToView->getId()}" target="_blank">Printen</a><br/>

        <br/>

        <div class="row">
            <div class="span11">
            {if $this->session->userdata('loggedin')}
            {include file="comment/create.tpl"}
            {/if}
                {include file='comment/view.tpl'}
            </div>
        </div>
    </div>


{include file='../footer.tpl'}